package cmd

import (
	"github.com/spf13/cobra"

	"gitcode.com/goinit/goinit/internal/command/create"
	"gitcode.com/goinit/goinit/internal/command/new"
	"gitcode.com/goinit/goinit/internal/version"
)

var logo = `
 ██████╗  ██████╗ ██╗███╗   ██╗██╗████████╗
██╔════╝ ██╔═══██╗██║████╗  ██║██║╚══██╔══╝
██║  ███╗██║   ██║██║██╔██╗ ██║██║   ██║   
██║   ██║██║   ██║██║██║╚██╗██║██║   ██║   
╚██████╔╝╚██████╔╝██║██║ ╚████║██║   ██║   
 ╚═════╝  ╚═════╝ ╚═╝╚═╝  ╚═══╝╚═╝   ╚═╝   
`

var Root = &cobra.Command{
	Use: "goinit",
	Example: `  goinit new  	 module 	   [模块名称]
  goinit new 	 project 	   [项目名称] -m [模块名称] --mod [mod名称]
  goinit create  model 		-m [模块名称] -n [文件名称]
  goinit create  handler 	-m [模块名称] -n [文件名称]
  goinit create  service 	-m [模块名称] -n [文件名称]
  goinit create  repository 	-m [模块名称] -n [文件名称]`,
	Short:   version.SHORT,
	Version: version.VERSION,
}

func init() {
	Root.AddCommand(new.Root)
	Root.AddCommand(create.Root)
}

func Execute() error {
	return Root.Execute()
}
